<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>意达设计</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../css/member.css"/>

</head>
<body class="body bodyBG">

<!-- header -->
<div class="searchHeader foleth">
	<a href="javascript:void(0);" onclick="api.closeWin();"></a>
	<input type="text" id="key" placeholder="请输入搜索内容">
    <a href="javascript:void(0)" class="searchlink">搜索</a>
</div>

<div class="hr hrBG1 hrMargin"></div>

<!-- contact -->
<div class="bagnav">
	<div class="swiper-container bagnavheight">
        <div class="swiper-wrapper" id='cate'>
            <div class="swiper-slide"><a class="slideOn" href="javascript:void(0)">男包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">女包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">箱包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">双肩包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">手提包</a></div>
            <div class="swiper-slide"><a href="javascript:void(0)">斜挎包</a></div>
            
        </div>
    </div>
</div>
<div class="bagCont">
	<div class="bangimg"><img src="../image/page/img-005.jpg" style="width: 235px;height: 100px;" id='seryicon'></div>
	<div class="hr hrBG2" style="height: .3rem;background: #fff;"></div>
    
	<!-- <div class="bagtop"><span id='catename'></span></div> -->
	<div class="baglt bagltToo">
		<ul id='con'>
			<li>
				<a href="#"><img src="../image/page/img-011.jpg"></a>
				<p>波仕龍</p>
			</li>
			
		</ul>
	</div>
</div>
<div class="feashu"></div>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../script/adaptive.js"></script>
<script type="text/javascript" src="../script/swiper.min.js"></script>
<script type="text/javascript" src="../script/tabs.js"></script>
<script type="text/javascript">
    window['adaptive'].desinWidth = 750;
    window['adaptive'].baseFont = 28;
    window['adaptive'].maxWidth = 750;
    window['adaptive'].init();

    var swiperBanner = new Swiper('.swiper-container', {
            speed:400,
			freeMode: true,
            slidesPerView: 'auto',
			direction: 'vertical',
        });



var first=0;
var seryicon='';

    apiready = function () {
        $api.fixStatusBar($api.dom('.header'));
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err){
            api.closeWidget();
        });

       
        api.showProgress();

        var para=api.pageParam;



        sery()


 

		api. addEventListener({name:'scrolltobottom'}, function(ret, err){
            
            

        });

       
    };
    $('.searchlink').click(function(){
        var key=$('#key').val();
        if(key==""){
            alert('请输入搜索内容');return;
        }
        searchPlay(key);
    })
        
     function sery(){
        api.ajax({
            url: webSiteUrl+'/app/public/sery',
            method: 'post',
            data: {
                
                
            }
        }, function(ret, err) {
            api.hideProgress();
            
            if(ret.code==200){
                
               var tj=ret.data;

                first=tj[0].id;
                seryicon=tj[0].icon;
                $("#seryicon").attr('src',webSiteUrl+seryicon);

                html = "";
                for(var i=0;i<tj.length;i++){
                    html+= '<div class="swiper-slide" onclick="seryinfo('+tj[i].id+')" id="s_'+tj[i].id+'">';
                    if(i==0){
                        html+= '<a href="javascript:void(0);" class="slideOn">'+tj[i].name+'</a></div>';
                    }else{
                        html+= '<a href="javascript:void(0);" >'+tj[i].name+'</a></div>';
                    }

                }
                $('#cate').html(html);


                serygoods(parseInt(first));


            }else{alert(ret.msg)}
        });
    }

    function seryinfo(id){

        $("#s_"+id).find('a').addClass('slideOn');
        $("#s_"+id).siblings().find('a').removeClass('slideOn');

    	var pa={id:id};

        api.ajax({
            url: webSiteUrl+'/app/public/getsery',
            method: 'post',
            data: {
                
                values: pa
            }
        }, function(ret, err) {
            api.hideProgress();
            if(ret.code==200){
                
                $('#seryicon').attr('src',webSiteUrl+ret.data.icon);

                serygoods(id);
            }
        });


    	
    }
    function serygoods(id){
        
        var p= {type:3,id:id};

        api.ajax({
            url: webSiteUrl+'/app/public/getgoods',
            method: 'post',
            data: {
                
                values: p
            }
        }, function(ret, err) {
            api.hideProgress();
            
            if(ret.code==200){
                
               var tj=ret.data;

                html = "";
                for(var i=0;i<tj.length;i++){
html+= '<li onclick="detailPlay('+tj[i].id+')"><a href="javascript:void(0);"><img src="'+webSiteUrl+tj[i].icon+'"></a><p>'+tj[i].name+'</p></li>';
                }
                $('#con').html(html);

            }else{
                //alert(ret.msg)
            }
        });
    }

</script>

</html>
